<style lang="less">
	.navhead {
		padding: 0 30rpx;
		height: 88rpx;
		border-bottom: 1px solid #EDEDED;

		.icon-zuo {
			font-size: 32rpx;
			color: #333;
		}
	}
	.form_item{
		height: 90rpx;
		padding: 0 30rpx;
		font-size: 28rpx;
		color: #333;
		&>view{
			margin: 0 20rpx 0 0;
		}
	}
	.btn{
		width: 80%;
		height: 80rpx;
		background: rgba(255,0,0,0.7);
		color: #fff;
		font-size: 30rpx;
		border-radius: 50rpx;
		margin: 50rpx auto 0;
		font-weight: 500;
		letter-spacing: 1px;
		&:active{
			opacity: 0.8;
		}
	}
	.tis{
		margin: 100rpx 30rpx 0;
		&>view{
			font-size: 27rpx;
			line-height: 55rpx;
			letter-spacing: 1px;
			color: #666;
			font-weight: 500;
		}
		text{
			color: red;
		}
	}
</style>
<template>
	<view>
		<view class="status_bar"></view>
		<view class="navhead flex_r_between">
			<i class='iconfont icon-zuo' @click='navBack'></i>
			<text>管理支付宝</text>
			<text></text>
		</view>
		<view class="form_item flex_v_venter">
			<view class="">
				支付宝账号:
			</view>
			<input style="flex: 1;" v-model="accont" placeholder-style="font-size:27rpx" type="text" placeholder="请输入支付宝账户" value="" />
		</view>
		<view class="form_item flex_v_venter">
			<view class="">
				支付宝姓名:
			</view>
			<input style="flex: 1;" type="text" v-model="name" placeholder-style="font-size:27rpx" placeholder="请填写真实姓名" value="" />
		</view>
		<view class="btn flex_center" :style="accont.length && name.length ? '' : 'opacity: 0.4;' " @click="bind">
			安全绑定极速提现
		</view>
		<view class="tis">
			<view class="">
				温馨提示:
			</view>
			<view class="">
				1.请确保支付宝已实名认证，并填写<text>真实姓名（请不要填写昵称）</text>
			</view>
			<view class="">
				2.为了保证顺利提现。<text>30天内</text>不要更换其他账号，否则会导致提现不通过
			</view>
			<view class="">
				3.我们承诺不会向任何人透露您的信息
			</view>
		</view>
		<task-complate2 />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				accont:'',
				name:''
			};
		},
		methods:{
			bind() {
				if(!this.accont.length || !this.name.length){
					return false
				}
				this.$ajax('/user/bindAlipay',{alipayAccount:this.accont,name:this.name},'post').then(res => {
					if(res.data.code == 0){
						uni.showToast({
							title:'绑定成功',
							duration:2000,
							complete() {
								setTimeout(() => {uni.navigateBack()},2000)
							}
						})
						this.$store.commit('setUser', {...this.$store.state.userInfo, alipayAccount: this.accont})
						
						if(res.data.obj.task?.finish & res.data.obj.update){
							this.$store.commit('setComplateTask', item.task)
						}
					}
				})
			},
			navBack(){
				uni.navigateBack()
			}
		}
	}
</script>
